<html xmlns="http://www.w3c.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<script type="text/javascript">
		//<![CDATA[
		//debe usarse los \\:  en lugar de : en los selectores de JQuery
		$(document).ready(function() {
			wizardSetCurrentPageStyle('form_wizard:innovationData');

		});
		//]]>
	</script>
</h:head>
<h:body>

	<h:form id="form_innovation_data">
		<h2>
			<h:outputLabel value="#{i18n['lbl.owner.innovation.title']}" />
		</h2>
		<div class="clearfix common-panel">
			<div class="ui-form-row-2col clearfix">
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel
							value="#{i18n['lbl.owner.innovation.participation']}" />
					</div>
					<div class="clearfix text-align-left">
						<p:selectOneRadio id="radioPartOfInnovation"
							value="#{aSession.selectedRuatRegister.innovationProcesses}"
							onchange="disabledFuction();">
							<f:selectItem itemLabel="Si" itemValue="1" />
							<f:selectItem itemLabel="No" itemValue="2" />
							<f:ajax event="click" render="tableInnovationInt" />
						</p:selectOneRadio>
					</div>
				</div>
				<div class="ui-form-col"></div>
			</div>
		</div>

		<!-- Produccion -->
		<p:blockUI block="tableInnovation" widgetVar="buitableInnovation" />
		<p:panel id="tableInnovation">
			<p:panel id="tableInnovationInt">
				<div class="ui-form-row-2col clearfix common-panel">
					<div class="ui-form-col">
						<div class="ui-form-row-2col clearfix">
							<div class="ui-form-col">
								<h4>
									<h:outputLabel
										value="#{i18n['lbl.owner.innovation.pruduction']}" />
								</h4>
							</div>
							<div class="ui-form-col">
								<p:commandButton value="Nuevo" styleClass="ui-flowbutton"
									actionListener="#{processTransferInnovationController.createNewProductionProcessRegister}"
									update=":form_innovation_data:productionProcess"
									id="NewProduction" partialSubmit="true" />
							</div>
						</div>
					</div>
					<div class="ui-form-col" style="width: 600px">
						<div class="ui-form-row-3col clearfix">
							<div class="ui-form-col" style="width: 150px">
								<h:outputLabel value="#{i18n['lbl.owner.innovation.source']}" />
							</div>
							<div class="ui-form-col" style="width: 200px">
								<h:outputLabel
									value="#{i18n['lbl.owner.innovation.description']}" />
							</div>
							<div class="ui-form-col" style="width: 150px" />
						</div>
						<p:dataGrid id="productionProcess" var="register"
							value="#{aSession.processTransferInnovation.productionProcess}"
							columns="1" emptyMessage="">

							<div class="ui-form-row-3col clearfix">
								<div class="ui-form-col" style="width: 150px">
									<div class="clearfix text-align-left">
										<p:selectOneMenu value="#{register.source}"
											required="#{aSession.selectedRuatRegister.innovationProcesses==1}"
											requiredMessage="#{i18n['cmpnt.required']}">
											<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
												itemValue="" noSelectionOption="true" />
											<f:selectItems
												value="#{activityProductionSourceCmb.parameterDTO.options}" />
											<f:selectItem itemLabel="#{i18n['cmpnt.other']}"
												itemValue="3" />
											<f:ajax event="change" render="otherSourceProduction" />
										</p:selectOneMenu>
									</div>
									<div class="clearfix text-align-left">
										<p:inputText disabled="#{!(register.source==3)}"
											id="otherSourceProduction" value="#{register.sourceOther}"
											required="true" requiredMessage="#{i18n['cmpnt.required']}" />
									</div>

								</div>
								<div class="ui-form-col" style="width: 200px">
									<p:inputText value="#{register.description}"
										required="#{aSession.selectedRuatRegister.innovationProcesses==1}"
										requiredMessage="#{i18n['cmpnt.required']}" />
								</div>
								<div class="ui-form-col" style="width: 150px">
									<p:commandButton value="-" style="margin-top: 7px;"
										update=":form_innovation_data:productionProcess"
										actionListener="#{processTransferInnovationController.deleteProductionProcessRegister}"
										process="@this">
										<f:attribute name="register" value="#{register}" />
									</p:commandButton>
								</div>
							</div>
						</p:dataGrid>
					</div>
				</div>

				<!-- Transformacion -->
				<div class="ui-form-row-2col clearfix common-panel">
					<div class="ui-form-col">
						<div class="ui-form-row-2col clearfix">
							<div class="ui-form-col">
								<h4>
									<h:outputLabel
										value="#{i18n['lbl.owner.innovation.transformation']}" />
								</h4>
							</div>
							<div class="ui-form-col">
								<p:commandButton value="Nuevo" styleClass="ui-flowbutton"
									actionListener="#{processTransferInnovationController.createNewTransformationProcessRegister}"
									update=":form_innovation_data:transformationProcess"
									id="NewTransformation" partialSubmit="true" />
							</div>
						</div>
					</div>
					<div class="ui-form-col" style="width: 600px">
						<div class="ui-form-row-3col clearfix">
							<div class="ui-form-col" style="width: 150px">
								<h:outputLabel value="#{i18n['lbl.owner.innovation.source']}" />
							</div>
							<div class="ui-form-col" style="width: 200px">
								<h:outputLabel
									value="#{i18n['lbl.owner.innovation.description']}" />
							</div>
							<div class="ui-form-col" style="width: 150px" />
						</div>
						<p:dataGrid id="transformationProcess" var="register"
							value="#{aSession.processTransferInnovation.transformationProcess}"
							columns="1" emptyMessage="">

							<div class="ui-form-row-3col clearfix">
								<div class="ui-form-col" style="width: 150px">
									<div class="clearfix text-align-left">
										<p:selectOneMenu value="#{register.source}"
											required="#{aSession.selectedRuatRegister.innovationProcesses==1}"
											requiredMessage="#{i18n['cmpnt.required']}">
											<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
												itemValue="" noSelectionOption="true" />
											<f:selectItems
												value="#{activityTransformationSourceCmb.parameterDTO.options}" />
											<f:selectItem itemLabel="#{i18n['cmpnt.other']}"
												itemValue="3" />
											<f:ajax event="change" render="otherSourceTransformation" />
										</p:selectOneMenu>

									</div>
									<div class="clearfix text-align-left">
										<p:inputText disabled="#{!(register.source==3)}"
											id="otherSourceTransformation" value="#{register.sourceOther}"
											required="true" requiredMessage="#{i18n['cmpnt.required']}" />
									</div>
								</div> 
								<div class="ui-form-col" style="width: 200px">
									<p:inputText value="#{register.description}"
										required="#{aSession.selectedRuatRegister.innovationProcesses==1}"
										requiredMessage="#{i18n['cmpnt.required']}" />
								</div>
								<div class="ui-form-col" style="width: 150px">
									<p:commandButton value="-" style="margin-top: 7px;"
										update=":form_innovation_data:transformationProcess"
										actionListener="#{processTransferInnovationController.deleteTransformationProcessRegister}"
										process="@this">
										<f:attribute name="register" value="#{register}" />
									</p:commandButton>
								</div>
							</div>
						</p:dataGrid>
					</div>
				</div>
				<!-- Comercializacion -->
				<div class="ui-form-row-2col clearfix common-panel">
					<div class="ui-form-col">
						<div class="ui-form-row-2col clearfix">
							<div class="ui-form-col">
								<h4>
									<h:outputLabel
										value="#{i18n['lbl.owner.innovation.merchandising']}" />
								</h4>
							</div>
							<div class="ui-form-col">
								<p:commandButton value="Nuevo" styleClass="ui-flowbutton"
									actionListener="#{processTransferInnovationController.createNewCommercializationProcessRegister}"
									update=":form_innovation_data:commercializationProcess"
									id="NewCommercialization" partialSubmit="true" />
							</div>
						</div>
					</div>
					<div class="ui-form-col" style="width: 600px">
						<div class="ui-form-row-3col clearfix">
							<div class="ui-form-col" style="width: 150px">
								<h:outputLabel value="#{i18n['lbl.owner.innovation.source']}" />
							</div>
							<div class="ui-form-col" style="width: 200px">
								<h:outputLabel
									value="#{i18n['lbl.owner.innovation.description']}" />
							</div>
							<div class="ui-form-col" style="width: 150px" />
						</div>
						<p:dataGrid id="commercializationProcess" var="register"
							value="#{aSession.processTransferInnovation.commercializationProcess}"
							columns="1" emptyMessage="">

							<div class="ui-form-row-3col clearfix">
								<div class="ui-form-col" style="width: 150px">
								<div class="clearfix text-align-left">
									<p:selectOneMenu value="#{register.source}"
										required="#{aSession.selectedRuatRegister.innovationProcesses==1}"
										requiredMessage="#{i18n['cmpnt.required']}">
										<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
											itemValue="" noSelectionOption="true" />
										<f:selectItems
											value="#{activityMerchandisingSourceCmb.parameterDTO.options}" />
										<f:selectItem itemLabel="#{i18n['cmpnt.other']}" itemValue="3" />
											<f:ajax event="change" render="otherSourceCommercialization" />
										</p:selectOneMenu>

									</div>
									<div class="clearfix text-align-left">
										<p:inputText disabled="#{!(register.source==3)}"
											id="otherSourceCommercialization" value="#{register.sourceOther}"
											required="true" requiredMessage="#{i18n['cmpnt.required']}" />
									</div>
								</div>
								<div class="ui-form-col" style="width: 200px">
									<p:inputText value="#{register.description}"
										required="#{aSession.selectedRuatRegister.innovationProcesses==1}"
										requiredMessage="#{i18n['cmpnt.required']}" />
								</div>
								<div class="ui-form-col" style="width: 150px">
									<p:commandButton value="-" style="margin-top: 7px;"
										update=":form_innovation_data:commercializationProcess"
										actionListener="#{processTransferInnovationController.deleteCommercializationProcessRegister}"
										process="@this">
										<f:attribute name="register" value="#{register}" />
									</p:commandButton>
								</div>
							</div>
						</p:dataGrid>
					</div>
				</div>

				<!-- Organizacion -->
				<div class="ui-form-row-2col clearfix common-panel">
					<div class="ui-form-col">
						<div class="ui-form-row-2col clearfix">
							<div class="ui-form-col">
								<h4>
									<h:outputLabel
										value="#{i18n['lbl.owner.innovation.organizational']}" />
								</h4>
							</div>
							<div class="ui-form-col">
								<p:commandButton value="Nuevo" styleClass="ui-flowbutton"
									actionListener="#{processTransferInnovationController.createNewOrganizationalProcessRegister}"
									update=":form_innovation_data:organizationalProcess"
									id="NewOrganizational" partialSubmit="true" />
							</div>
						</div>
					</div>
					<div class="ui-form-col" style="width: 600px">
						<div class="ui-form-row-2col clearfix">
							<div class="ui-form-col" style="width: 150px">
								<h:outputLabel value="#{i18n['lbl.owner.innovation.source']}" />
							</div>
							<div class="ui-form-col" style="width: 200px">
								<h:outputLabel
									value="#{i18n['lbl.owner.innovation.description']}" />
							</div>
							<div class="ui-form-col" style="width: 150px" />
						</div>
						<p:dataGrid id="organizationalProcess" var="register"
							value="#{aSession.processTransferInnovation.organizationalProcess}"
							columns="1" emptyMessage="">

							<div class="ui-form-row-3col clearfix">
								<div class="ui-form-col" style="width: 150px">
								<div class="clearfix text-align-left">
									<p:selectOneMenu value="#{register.source}"
										required="#{aSession.selectedRuatRegister.innovationProcesses==1}"
										requiredMessage="#{i18n['cmpnt.required']}">
										<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
											itemValue="" noSelectionOption="true" />
										<f:selectItems
											value="#{activityOrganizationalSourceCmb.parameterDTO.options}" />
										<f:selectItem itemLabel="#{i18n['cmpnt.other']}" itemValue="3" />
											<f:ajax event="change" render="otherSourceOrganizational" />
										</p:selectOneMenu>

									</div>
									<div class="clearfix text-align-left">
										<p:inputText disabled="#{!(register.source==3)}"
											id="otherSourceOrganizational" value="#{register.sourceOther}"
											required="true" requiredMessage="#{i18n['cmpnt.required']}" />
									</div>
								</div>
								<div class="ui-form-col" style="width: 200px">
									<p:inputText value="#{register.description}"
										required="#{aSession.selectedRuatRegister.innovationProcesses==1}"
										requiredMessage="#{i18n['cmpnt.required']}" />
								</div>
								<div class="ui-form-col" style="width: 150px">
									<p:commandButton value="-" style="margin-top: 7px;"
										update=":form_innovation_data:organizationalProcess"
										actionListener="#{processTransferInnovationController.deleteOrganizationalProcessRegister}"
										process="@this">
										<f:attribute name="register" value="#{register}" />
									</p:commandButton>
								</div>
							</div>
						</p:dataGrid>
					</div>
				</div>
			</p:panel>
		</p:panel>

		<div class="buttons-container clearfix text-align-right">
			<p:commandButton value="#{i18n['lbl.flow_button.cancel']}"
				styleClass="ui-flowbutton"
				oncomplete="currentPage('list_owner_data.xhtml')"
				actionListener="#{stepByStepController.cancelRuatRegister}" />
			<p:commandButton value="#{i18n['lbl.flow_button.back']}"
				oncomplete="setCurrentPageStyle(xhr, status, args,this)"
				styleClass="ui-flowbutton" update="form_innovation_data"
				actionListener="#{stepByStepController.viewEconomicData}" />
			<p:commandButton value="#{i18n['lbl.flow_button.save_and_next']}"
				oncomplete="setCurrentPageStyle(xhr, status, args,this)"
				styleClass="ui-flowbutton" validateClient="true"
				update="form_innovation_data"
				actionListener="#{stepByStepController.viewAssociativityData}"
				id="savenext" />
		</div>
		<p:blockUI block="savenext" trigger="savenext" />

	</h:form>
</h:body>

<script type="text/javascript">
	//<![CDATA[
	//debe usarse los \\:  en lugar de : en los selectores de JQuery
	$(document).ready(function() {
		disabledFuction();
	});
	function disabledFuction() {
		var valor = $(
				'input[name=form_innovation_data\\:radioPartOfInnovation]:checked')
				.val();
		if (valor == 1) {
			PF('buitableInnovation').hide();

		} else {
			PF('buitableInnovation').show();
		}
	}
	//]]>
</script>

</html>